﻿using EasyAdmin.Domain.Shared.Enums;
using EasyCore.Domain.Entities;
using EasyCore.Entities;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EasyAdmin.Domain.Entities.Systems
{
    /// <summary>
    /// 用户表
    ///</summary>
    [SugarTable("sys_user")]
    public class SysUser :FullAuditedEntity
    {
        /// <summary>
        /// 用户唯一标识
        /// </summary>
        [SugarColumn(IsIdentity = true,IsPrimaryKey = true,ColumnDescription ="唯一标识")]
        public long Id { get; set; }

        /// <summary>
        /// 姓名
        /// </summary>
        [SugarColumn(IsNullable = false,ColumnDescription ="姓名",Length = 20)]
        public virtual string Name { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "性别",ColumnDataType = "int")]
        public Gender Gender { get; set; }

        /// <summary>
        /// 出生日期
        /// </summary>
        [SugarColumn(IsNullable = true,ColumnDescription = "出生日期")]
        public DateTime? Birthday { get; set; }

        /// <summary>
        /// 昵称
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "昵称")]
        public string Nickname { get; set; }

        /// <summary>
        /// 账号
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "账号",Length = 20)]
        public virtual string Account { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "密码", Length = 100)]
        public string Password { get; set; }

        /// <summary>
        /// 头像
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "头像", ColumnDataType ="TEXT")]
        public virtual string Avatar { get; set; }

        /// <summary>
        /// 签名
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "签名", ColumnDataType = "TEXT")]
        public string Signature { get; set; }

        /// <summary>
        /// 机构id
        /// </summary>
        [SugarColumn(IsNullable = false,ColumnDescription = "所属机构")]
        public virtual long OrgId { get; set; }

        /// <summary>
        /// 职位id
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "职位唯一标识")]
        public virtual long? PositionId { get; set; }

        /// <summary>
        /// 是否禁用
        /// </summary>  
        [SugarColumn(IsNullable = false, ColumnDescription = "是否禁用")]
        public bool IsDisabled { get; set; }
    }
}
